<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!-- alan_18.2.7 -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
<head>
<base href="<%=basePath%>">
<title>创建表格</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="${base}/css/bootstrap.css">
<link href="${base}/css/font-awesome.css?v=4.4.0" rel="stylesheet">
<!-- Sweet Alert -->
<link href="${base}/css/plugins/sweetalert/sweetalert.css"
	rel="stylesheet">
<link href="${base}/css/animate.css" rel="stylesheet">

<script type="text/javascript" src="${base}/js/jquery-3.1.0.js"></script>
<script type="text/javascript" src="${base}/js/bootstrap.js"></script>
<script src="${base}/js/content.js?v=1.0.0"></script>
<!-- Sweet alert -->
<script src="${base}/js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="${base}/js/plugins/layer/layer.min.js"></script>
</head>

<body>
	<div class="container">
		<jsp:include page="${path}/menu.jsp"></jsp:include>
		<div style="margin-left: 20px;margin-bottom: 10px; color: grey">当前位置：表格管理 > 添加表格</div>
		
		<div class="container-fluid">
			<div class="row-fluid">
				<div class="col-md-4">
					
					<input type="button" class="btn btn-success" value="选择模板"></a>
				</div>
				<div class="span12">

					<!-- alan_18.2.7_start_update_style -->
					<table class="table table-striped table-bordered table-hover dataTables-example">
						<thead>
							<tr bgcolor="#9BCD9B">
								<th>模板名</th>
								<th>缩略图</th>
								<th>创建人</th>
								<th>创建时间</th>
								<th>模板描述</th>
							</tr>
						</thead>
						<tbody>
							
							<c:forEach items="${templateList}" var="template">
								<tr class="gradeX">
									<td><a href="${pageContext.request.contextPath}/tpl/template?templateId=${template.id}">${template.templateName }</a></td>
									<td><a onmouseover="showTemplate(${template.id})" href="${pageContext.request.contextPath}/tpl/template?templateId=${template.id}">缩略图</a></td>
									<td>张三</td>
									<td>
										<fmt:formatDate type="both" dateStyle="short" timeStyle="short" value="${template.createDate}" />
										<!-- alan_18.2.7_end_update_style -->
									</td>
									<td></td>
									
								</tr>
							</c:forEach>
							
					</table>
					<div>
						<a href="${base}/table/create2"><input type="button"
							class="btn btn-success" value="自定义表格"></a>
							
					<%-- 		<a href="${base}/uploadTable.jsp"><input type="button"
							class="btn btn-success" value="本地上传"></a> --%>
					</div>

				</div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	
	function showTemplate(obj){
	    layer.open({
	      type: 2,
	      title: 'iframe父子操作',
	      maxmin: true,
	      shadeClose: true, //点击遮罩关闭层
	      area : ['800px' , '520px'],
	      content: 'http://127.0.0.1:8082/Excel/tpl/showTemplate?templateId='+obj
	      /*  content: 'http://baidu.com' */
	    });
	  };


	$('.delete').click(function() {
		swal({
			title : "您确定要删除该模板吗",
			text : "删除后将无法恢复，请谨慎操作！",
			type : "warning",
			showCancelButton : true,
			confirmButtonColor : "#DD6B55",
			confirmButtonText : "删除",
			closeOnConfirm : false
		}, function() {

			swal("删除成功！", "您已经删除了该模板。", "success");

		});
	});

</script>
</html>


